<html>
<head>
	<title>test</title>
</head>
<body>
<script type="text/javascript">
	String.prototype.trim = function() {
		return (this.replace(/^[\s\xa0]+/,"").replace(/[\s\xa0]+$/,"")) ;
	}
	var sObj = new String("      This is the string      ");
	var sTex = sObj.trim();
	document.writeln("<p>--" + sObj + "--</p>");
	document.writeln("<p>--" + sTex + "--</p>");
</script>
</body>
</html>